package com.team.teamuserservice.uitls;

import java.util.concurrent.atomic.AtomicLong;

/**
 * ID生成工具类
 */
public class IdGenerator {
    
    private static final AtomicLong sequence = new AtomicLong(0);
    
    /**
     * 生成时间戳+序列号的ID
     * @return 长整型ID
     */
    public static Long generateLongId() {
        return System.currentTimeMillis() * 1000 + sequence.incrementAndGet() % 1000;
    }
    
    /**
     * 生成简单的数字ID（基于时间戳）
     * @return 长整型ID
     */
    public static Long generateSimpleId() {
        return System.currentTimeMillis();
    }
    
    /**
     * 生成递增ID
     * @return 长整型ID
     */
    public static Long generateIncrementId() {
        return sequence.incrementAndGet();
    }
} 